import request from '@/utils/request'

// 查询记账单列表
export function listFinanceOrder(query) {
  return request({
    url: '/finance/financeOrder/list',
    method: 'post',
    data: query
  })
}

// 查询记账单详细
export function getFinanceOrder(id) {
  return request({
    url: '/finance/financeOrder/' + id,
    method: 'get'
  })
}

// 查询记账单列表
export function getFinanceOrders(ids) {
  return request({
    url: '/finance/financeOrder/list',
    method: 'post',
    data: {
      ids:ids
    }
  })
}

// 新增记账单
export function addFinanceOrder(data) {
  return request({
    url: '/finance/financeOrder/add',
    method: 'post',
    data: data
  })
}

// 修改记账单
export function updateFinanceOrder(data) {
  return request({
    url: '/finance/financeOrder/update',
    method: 'post',
    data: data
  })
}

// 作废记账单
export function closeFinanceOrder(id) {
  return request({
    url: '/finance/financeOrder/close/' + id,
    method: 'post'
  })
}

export function auditFinanceOrder(id) {
  return request({
    url: '/finance/financeOrder/audit/' + id,
    method: 'post'
  })
}

export function auditCancelFinanceOrder(id) {
  return request({
    url: '/finance/financeOrder/auditCancel/' + id,
    method: 'post'
  })
}

export function updateExpectPayBackDate(data) {
  return request({
    url: '/finance/financeOrder/expectPayBackDate/update',
    method: 'post',
    data: data
  })
}

export function uploadInvoice(data){
  return request({
    url: '/finance/financeOrder/uploadInvoice',
    method: 'post',
    data: data
  })
}
